package com.nettest.action.system;

import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;

import com.nettest.action.BaseJsonAction;
import com.nettest.bean.system.DictCriteriaVo;
import com.nettest.common.DictionaryData;
import com.nettest.entity.system.Dictionary;

@Action("dictQuery")
@Namespace("/system/dict")
public class DictionaryQueryAction extends BaseJsonAction {
	private static final long serialVersionUID = 6112400682180451884L;
	
	private String category;
	private List<Dictionary> dictList;
	@Autowired
	private DictionaryData dictionaryData;
	
	@Action(value = "get", results = { @Result(name = "success", type = "json", params = {
			"ignoreHierarchy", "false", "excludeNullProperties", "true",
			"excludeProperties", "criteria,dictionaryService","root","dictList" }) })
	public String get() throws Exception {
		dictList = dictionaryData.getDictionary(category);
		return SUCCESS;
	}
	
	public List<Dictionary> getDictList() {
		return dictList;
	}
	public void setDictList(List<Dictionary> dictList) {
		this.dictList = dictList;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}
}
